package model

import (
	"gorm.io/gorm"
	"time"
)

type BaseModel struct {
	ID        int32     `gorm:"primary_key" json:"id,omitempty"`
	CreatedAt time.Time `gorm:"column:add_time" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:update_time" json:"updated_at"`
	DeletedAt gorm.DeletedAt
	IsDelete  bool `gorm:"clolumn:is_delete" json:"is_delete"`
}

type User struct {
	BaseModel
	Mobile   string     `gorm:"idx_mobile; unique; :varchar(11)"; not null`
	Password string     `gorm:"type:varchar(100)"; not null`
	NickName string     `gorm:"type:varchar(20)"`
	Birthday *time.Time `gorm:"type:datetime"`
	Gender   string     `gorm:"column:gender;default:male;type:varchar(6) comment 'female标识女，male标识男'"`
	Role     int32      `gorm:"column:role;default:1;type:int comment '1标识普通用户，2标识管理员'"`
}
